package co.gov.medellin.ssti.sub.paoyer.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;

import co.gov.medellin.ssti.sub.paoyer.common.exception.CommonUserException;
import co.gov.medellin.ssti.sub.paoyer.common.exception.UserException;

//TODO: purge?
public class Conversion {
	public Conversion() {
	}

	public static Date convertStringToDate(String strDate) {
		Date date = null;
		try {
			SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
			date = format.parse(strDate);
		} catch (Exception e) {
			throw new UserException(new CommonUserException().getModuleVO(),
					CommonUserException.INCORRECT_DATE_FORMAT);
		}
		return date;
	}
}